package com.pwt.repository;

import com.pwt.repository.base.BaseRepository;
import com.pwt.entity.WhatStatistics;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * WhatStatistics Repository层
 *
 * @author auto generated
 * @date 2021-09-04 14:18:52
 */
public interface WhatStatisticsRepository extends BaseRepository<WhatStatistics, String> {

    @Query(nativeQuery = true,value = "delete from [what_statistics] where  what_result_id  = ?1")
    @Modifying
    public void deleteByWhatId(String resultId);

    public List<WhatStatistics> findByWhatResultId(String whatResultId);

    @Query(nativeQuery = true,value = "select  product_statistics_id from [what_statistics] where  what_result_id  = ?1")
    List<String> findStatisticsByWhatResultId(String whatResultId);
}
